Simplify the interface and hide internal implementations that do not need to be exported#15
Merged
FrozenLemonTee merged 14 commits intomainfrom Mar 24, 2026
Merged
Simplify the interface and hide internal implementations that do not need to be exported#15FrozenLemonTee merged 14 commits intomainfrom
FrozenLemonTee merged 14 commits intomainfrom
Conversation
Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…nd acceptance criteria Signed-off-by: FrozenlemonTee <1115306170@qq.com>
…ispatcher and operators
…e in operators module
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the primitives “meta” surface area to expose a simpler, more stable set of traits/concepts while moving several helper implementations out of the exported surface, and adds tests to validate the new meta APIs.
Changes:
- Export
meta::traitsas a cvref-stripping alias and introducemeta::primitive_typeplus category concepts (boolean,integer, etc.). - Hide internal policy/operation helper details by moving them out of exported namespaces (and adjust runtime fencing implementation).
- Add compile-time/unit tests to validate meta traits and concepts.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/basic/test_underlying.cpp | Adds tests validating new meta::traits and category concepts. |
| src/primitive/traits.cppm | Refactors exported meta traits API and adds new primitive category concepts. |
| src/policy/impl.cppm | Moves a set of helper templates/utilities into a non-exported details namespace. |
| src/operations/operators.cppm | Updates operator/dispatch templates to use meta::primitive_type and hides internal concepts. |
| src/operations/invoker.cppm | Re-scopes runtime details and updates runtime fence logic to if !consteval. |
| src/operations/dispatcher.cppm | Switches dispatcher constraints to meta::primitive_type and adjusts traits access. |
| .github/copilot-instructions.md | Updates pointer to the current plans directory location. |
| .agents/docs/plans/implementation-plan.md | Adds an implementation plan document under .agents/docs/plans/. |
Comments suppressed due to low confidence (1)
src/operations/dispatcher.cppm:30
lhs_traits::value_type/rhs_traits::value_typeare dependent member type names inside a class template; they need thetypenamekeyword (otherwise this is ill-formed in standard C++).
using lhs_traits = meta::traits<lhs_primitive>;
using rhs_traits = meta::traits<rhs_primitive>;
using lhs_value_type = lhs_traits::value_type;
using rhs_value_type = rhs_traits::value_type;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.